package org.xp.judgeplatform.converter;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.xp.judgeplatform.pojo.entity.ProblemSet;
import org.xp.judgeplatform.pojo.vo.ProblemSetVO.ProblemSetVO;

import java.util.List;

@Mapper(componentModel = "spring")
public interface ProblemSetConverter {

    // 忽略需要单独处理的字段
    @Mapping(target = "creatorName", ignore = true)
    @Mapping(target = "userRole", ignore = true)
    @Mapping(target = "problems", ignore = true)
    ProblemSetVO toProblemSetVO(ProblemSet problemSet);

    // 列表转换
    List<ProblemSetVO> toProblemSetVOList(List<ProblemSet> problemSetList);
}